package com.eastcom.dataquality.core.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.eastcom.dataquality.core.module.Atom_SmoothStrategy;

public class SmoothStrategyDao extends JdbcDaoSupport implements RowMapper<Atom_SmoothStrategy>{

	public List<Atom_SmoothStrategy> findAll(){
		String sql="select * from qa_smooth_strategy";
		List<Atom_SmoothStrategy> results=getJdbcTemplate().query(sql, this);
		return results;
	}

	public Atom_SmoothStrategy mapRow(ResultSet rs, int rowNum)
			throws SQLException {
		Atom_SmoothStrategy smoothStrategy=new Atom_SmoothStrategy();
		smoothStrategy.setId(rs.getString("id"));
		smoothStrategy.setStrategyType(rs.getInt("strategytype"));
		smoothStrategy.setDistanceRange(rs.getInt("distanceRange"));
		smoothStrategy.setFactor(rs.getFloat("factor"));
		smoothStrategy.setScatter(rs.getBoolean("scatter"));
		smoothStrategy.setDistanceCount(rs.getInt("distancecount"));
		return smoothStrategy;
	}
}
